﻿namespace RAP.Framework.Libary.DomTemplateBuilder
{
  /// <summary>
  /// 常量定义
  /// </summary>
  public static class Consts
  {
    /// <summary>
    /// %
    /// </summary>
    public static string EXPRESSION_FLAG = "%";

    /// <summary>
    /// $
    /// </summary>
    public static string CONST_FLAG = "$";

    /// <summary>
    /// @
    /// </summary>
    public static string ALPHA_FLAG = "@";

    /// <summary>
    /// :
    /// </summary>
    public static string COLON_FLAG = ":";

    /// <summary>
    /// 或运算
    /// </summary>
    public static string OR_FLAG = "||";

    /// <summary>
    /// @value
    /// </summary>
    public static string VALUE_PREFIX = "@value";

    /// <summary>
    /// 根节点的参数：@root
    /// </summary>
    public static string ROOT_PREFIX = "@root";

    /// <summary>
    /// 根节点的参数：@param
    /// </summary>
    public static string PARAM_PREFIX = "@param";

    /// <summary>
    /// 父节点的参数：@parent
    /// </summary>
    public static string PARENT_PREFIX = "@parent";

    /// <summary>
    /// 上下文参数：@context
    /// </summary>
    public static string CONTEXT_PREFIX = "@context";

    /// <summary>
    /// 当前模板的Attributes：@attrs
    /// </summary>
    public static string CURRENT_ATTRIBUTES = "@attrs";

    /// <summary>
    /// Replace
    /// </summary>
    public static string REPLACE_RENDER_ID = "Replace";

    /// <summary>
    /// EndTemplate
    /// </summary>
    public static string END_TEMPLATE_FLAG = "EndTemplate";

    /// <summary>
    /// Callback
    /// </summary>
    public static string TEMPLATE_CALLBACK = "Callback";

    /// <summary>
    /// 回调的结果参数：callback-result
    /// </summary>
    public static string TEMPLATE_CALLBACK_RESULT = "callback-result";

    /// <summary>
    /// IsBreak
    /// </summary>
    public static string BREAK_FIELD = "IsBreak";

    /// <summary>
    /// ,
    /// </summary>
    public static string[] STRING_SPLIT_CHAR = new string[] { "," };

    /// <summary>
    /// ContentRender
    /// </summary>
    public static string CONTENT_RENDER_FIELD = "ContentRender";

    /// <summary>
    /// ValueStyle
    /// </summary>
    public const string VALUE_STYLE_FIELD = "ValueStyle";

    /// <summary>
    /// HandlerName
    /// </summary>
    public const string HANDLER_NAME_FIELD = "HandlerName";
  }

  /// <summary>
  /// 条件连接方式枚举常量定义
  /// </summary>
  public enum ConditionJoinTypes : int
  {
    /// <summary>
    /// 未设置
    /// </summary>
    None = 0,

    /// <summary>
    /// 或
    /// </summary>
    Or = 1,

    /// <summary>
    /// 与
    /// </summary>
    And = 2
  }

  /// <summary>
  /// 模板的可访问性枚举常量定义
  /// </summary>
  public enum TemplateAccessTypes : int
  {
    /// <summary>
    /// 未设置
    /// </summary>
    Notset = -1,

    /// <summary>
    /// 全局模板
    /// </summary>
    Public = 0,

    /// <summary>
    /// 内部模板，只能在同一个名称空间内访问
    /// </summary>
    Internal = 1,

    /// <summary>
    /// 私有模板，只能在同一个模板文件中访问
    /// </summary>
    Private = 2,

    /// <summary>
    /// 闭包模板，子模板使用，只能是父模板访问
    /// </summary>
    Closure = 4
  }

  /// <summary>
  /// 时间类型枚举常量
  /// </summary>
  public enum TimeStyles : int
  {
    /// <summary>
    /// 未设定
    /// </summary>
    None = 0,
    /// <summary>
    /// 年份
    /// </summary>
    Year = 1,

    /// <summary>
    /// 季度
    /// </summary>
    Quarter = 2,

    /// <summary>
    /// 月份
    /// </summary>
    Month = 3,

    /// <summary>
    /// 周
    /// </summary>
    Week = 4,

    /// <summary>
    /// 日
    /// </summary>
    Day = 5
  }

  /// <summary>
  /// 模板自定义属性值类型
  /// </summary>
  public class CustomerAttributeValueTypes
  {
    /// <summary>
    /// 字符串内容
    /// </summary>
    public const string String = "String";

    /// <summary>
    /// JSON对象字符串
    /// </summary>
    public const string Object = "Object";
  }
}
